//
//  YSFoldClockViewController.m
//  YSKitDemo
//
//  Created by MOLBASE on 2018/8/13.
//  Copyright © 2018年 YangShen. All rights reserved.
//

#import "YSFoldClockViewController.h"

@interface YSFoldClockViewController () {
    NSTimer *_timer;
    YSFoldClock *_foldClock;
}

@end

@implementation YSFoldClockViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    _foldClock = [[YSFoldClock alloc] init];
    _foldClock.frame = self.view.bounds;
    _foldClock.date = [NSDate date];
    [self.view addSubview:_foldClock];

    _timer = [NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(updateTimeLabel) userInfo:nil repeats:true];
}

- (void)viewDidLayoutSubviews {
    [super viewDidLayoutSubviews];
    _foldClock.frame = self.view.bounds;
}

- (void)updateTimeLabel {
    _foldClock.date = [NSDate date];
}


/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
